define(function(require){
	var $ = require("jquery");
	var justep = require("$UI/system/lib/justep");
    var outterAMD1 = require("../misc/js/wxaction");
    //取消弹出框
    var quxiao=function(){
       $('#wxloading').css("display","none");
    }
	var Model = function(){
	 
		this.callParent();
	};
    //跳转登陆页面
	Model.prototype.row4Click = function(event){
        // justep.Shell.showPage("login");
         var tuiyao = this.comp("logindialog");
         var auditing = this.comp("dengluzhuantai");
         var row = auditing.getLastRow();
		 tuiyao.open({
			"data" : {
				"rowData" : row.toJson()
			}
		});
       
	};
    //跳转注册页面
<<<<<<< HEAD
	/*Model.prototype.row6Click = function(event){	   
        justep.Shell.showPage("register");
	};*/
=======
	Model.prototype.row6Click = function(event){	   
        justep.Shell.showPage("register");
	};
>>>>>>> db50113a5feef0605bbbc3a649d7e9809a12c455
   //跳转个人中心，先判断登陆过，登陆以后才能跳转
	Model.prototype.li1Click = function(event){
	  if(window.token == null){
	       $('.wx_loading_inner').html("您还没登陆，请先登录！");
		   $('#wxloading').css("display","block"); 		   
		   setTimeout(quxiao,2000);
<<<<<<< HEAD
		 var tuiyao = this.comp("logindialog");
         var auditing = this.comp("dengluzhuantai");
         var row = auditing.getLastRow();
		 tuiyao.open({
			"data" : {
				"rowData" : row.toJson()
			}
		});
=======
		   justep.Shell.showPage("login");
>>>>>>> db50113a5feef0605bbbc3a649d7e9809a12c455
           return;
	  }
	  if(window.type == 1){
	    justep.Shell.showPage("mmgindex");
	  }else if(window.type == 2){
	    justep.Shell.showPage("zgindex");
	  }else if(window.type == 3){
	    justep.Shell.showPage("ygindex");
	  }
      
	};
   //登陆过，显示用户名信息
	Model.prototype.modelModelConstruct = function(event){
	 var dengz=this.comp("dengluzhuantai");
<<<<<<< HEAD
	 
=======
>>>>>>> db50113a5feef0605bbbc3a649d7e9809a12c455
	 if(window.token != null){
	   window.userstatus=1;
	 }else{
	   window.userstatus=0;
	 }
<<<<<<< HEAD
=======
	// alert(window.userstatus)
>>>>>>> db50113a5feef0605bbbc3a649d7e9809a12c455
	  var zuotis = {
                        defaultValues : [
                        { "id":justep.UUID.createUUID(),
                          "username":window.name,
                          "userstatus":window.userstatus
                        }
                        ]
                        };
                        dengz.newData(zuotis);
	  // alert(window.status)
      /*if(empty()){
      alert(window.name)
       $('.name').html(window.name);
       $('.denglu').css("display","none");
       $('.zhuce').css("display","none");
       $('.tuichu').css("display","block");
      }*/
	};
  //退出登录，返回刷新页面
	Model.prototype.button1Click = function(event){	   
<<<<<<< HEAD
     //   window.clear();
=======
        window.clear();
>>>>>>> db50113a5feef0605bbbc3a649d7e9809a12c455
        window.reload();
        
	};
   //跳转消息中心
	Model.prototype.li2Click = function(event){
	  if(window.token == null){
	       $('.wx_loading_inner').html("您还没登陆，请先登录！");
		   $('#wxloading').css("display","block"); 		   
		   setTimeout(quxiao,2000);
<<<<<<< HEAD
		     var tuiyao = this.comp("logindialog");
         var auditing = this.comp("dengluzhuantai");
         var row = auditing.getLastRow();
		 tuiyao.open({
			"data" : {
				"rowData" : row.toJson()
			}
		});
=======
		   justep.Shell.showPage("login");
>>>>>>> db50113a5feef0605bbbc3a649d7e9809a12c455
           return;
	  } 
      justep.Shell.showPage("xiaoxi"); 
	};
   //跳转关于平台	
   Model.prototype.li3Click = function(event){
	   if(window.token == null){
	       $('.wx_loading_inner').html("您还没登陆，请先登录！");
		   $('#wxloading').css("display","block"); 		   
		   setTimeout(quxiao,2000);
<<<<<<< HEAD
		     var tuiyao = this.comp("logindialog");
         var auditing = this.comp("dengluzhuantai");
         var row = auditing.getLastRow();
		 tuiyao.open({
			"data" : {
				"rowData" : row.toJson()
			}
		});
=======
		   justep.Shell.showPage("login");
>>>>>>> db50113a5feef0605bbbc3a649d7e9809a12c455
           return;
	  }
       justep.Shell.showPage("about"); 
	};
   //跳转设置中心
   Model.prototype.li4Click = function(event){
	  if(window.token == null){
	       $('.wx_loading_inner').html("您还没登陆，请先登录！");
		   $('#wxloading').css("display","block"); 		   
		   setTimeout(quxiao,2000);
<<<<<<< HEAD
		    var tuiyao = this.comp("logindialog");
         var auditing = this.comp("dengluzhuantai");
         var row = auditing.getLastRow();
		 tuiyao.open({
			"data" : {
				"rowData" : row.toJson()
			}
		});
=======
		   justep.Shell.showPage("login");
>>>>>>> db50113a5feef0605bbbc3a649d7e9809a12c455
           return;
	  } 
      justep.Shell.showPage("shezhi");
	};
    //跳转收藏中心
    Model.prototype.li5Click = function(event){
     if(window.token == null){
	       $('.wx_loading_inner').html("您还没登陆，请先登录！");
		   $('#wxloading').css("display","block"); 		   
		   setTimeout(quxiao,2000);
<<<<<<< HEAD
		   var tuiyao = this.comp("logindialog");
           var auditing = this.comp("dengluzhuantai");
           var row = auditing.getLastRow();
		    tuiyao.open({
			"data" : {
				"rowData" : row.toJson()
			}
		});
=======
		   justep.Shell.showPage("login");
>>>>>>> db50113a5feef0605bbbc3a649d7e9809a12c455
           return;
	  }
      justep.Shell.showPage("shoucang");
	};
	//登陆以后隐藏登陆按钮和注册按钮
	Model.prototype.logindialogReceive = function(event){
	   var fuji=this.getParentModel();
	   fuji.modelLoad();
	   $('.denglu').css("display","none");
       $('.zhuce').css("display","none");
       $('.tuichu').css("display","block");
	};
	return Model;
});